package singlton;

/**
 * @classname:User
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/22 22:29
 * @version: 0.1
 * @since:1.8
 */
public class User {

    /*  private User(){}
      private static User user = new User();

      public static User getInstance(){
          return user;
      }*/
    private User() {
    }

    private volatile static User user;

    public static User getInstance() {
        if (user == null) {
            synchronized ("a") {
                if (user == null) {
                    user = new User();
                }
            }
        }
        return user;
    }


}
